package com.neusoft.ysu.npms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.neusoft.ysu.npms.mapper.ApplypoorMapper;
import com.neusoft.ysu.npms.mapper.DepartmentMapper;
import com.neusoft.ysu.npms.mapper.MeasureMapper;
import com.neusoft.ysu.npms.pojo.*;
import com.neusoft.ysu.npms.service.IApplypoorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.management.monitor.Monitor;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 作者：刘金秋
 * @since 2024-06-18
 */
@Service
public class ApplypoorServiceImpl extends ServiceImpl<ApplypoorMapper, Applypoor> implements IApplypoorService {

    @Autowired
    ApplypoorMapper applypoorMapper;

    @Override
    public Result add(Applypoor applypoor) {
        return new Result<>(0, "", applypoorMapper.add(applypoor));
    }
    @Override
    public Result deleteApplypoor(Applypoor applypoor){
        return new Result<>(0,"",applypoorMapper.deleteApplypoor(applypoor));
    }

    @Override
    public Result updateApplypoor(Applypoor applypoor){
        return new Result<>(0,"",applypoorMapper.updateApplypoor(applypoor));
    }

    @Override
    public Result selectAll(){
        return new Result<>(0,"",applypoorMapper.selectAll());
    }
    @Override
    public Result findById(Applypoor applypoor){
        return new Result<>(0,"",applypoorMapper.findById(applypoor));
    }

    @Override
    public PageInfo getlist(MonitorInfo monitorInfo, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<MonitorInfo> infos=applypoorMapper.getlist(monitorInfo);
        return new PageInfo(infos);
    }
    @Override
    public Result add2(HelpPlus helpPlus) {
        return new Result<>(0, "", applypoorMapper.add2(helpPlus));
    }

    @Override
    public List<MonitorInfo> searchState(MonitorInfo monitorInfo){
        List<MonitorInfo> monitors=applypoorMapper.searchState(monitorInfo);
        return monitors;
    }
}
